/**
 * 二级页
 */

// -------------------------------二级页------------------------------------


if(location.href=="http://mw.jl.gov.cn/xwzx/"){
//新闻中心
	
	// 总计时器，保证目标加载完毕再执行js（轮播+国务动态四级选项卡）
	_EsdDynamicTransformationScript.intervalMwB = setInterval(function(){
		
		if( ( $("#demo3 .tips:eq(1) .nums a:eq(3)") != undefined ) 
				&& ( document.getElementsByTagName("iframe")[2].contentWindow.document.getElementsByTagName("a")[0]!=undefined )  ){
			clearInterval(_EsdDynamicTransformationScript.intervalMwB);
			
			partB_First();
			partB_Second();
			
		}
		
	}, 500);
	
	
	var partB_First = function(){
		
	//轮播前的标签
	 _EsdDynamicTransformationScript.esdTagFrontNum1 = $("#demo3 .zly_20190610 a");
	
	//原点和a的title合一起了
	 _EsdDynamicTransformationScript.esdTagCircleNum1 = $("#demo3 .tips:eq(1) .nums a:eq(0)");
	 _EsdDynamicTransformationScript.esdTagCircleNum2 = $("#demo3 .tips:eq(1) .nums a:eq(1)");
	 _EsdDynamicTransformationScript.esdTagCircleNum3 = $("#demo3 .tips:eq(1) .nums a:eq(2)");
	 _EsdDynamicTransformationScript.esdTagCircleNum4 = $("#demo3 .tips:eq(1) .nums a:eq(3)");
	
	//轮播后的标签
	 _EsdDynamicTransformationScript.esdTagAfterNum1 = $(".zlyxx .tabbox ul li:eq(0) a");

	//轮播前的焦点
	_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
		$(this).bind("keydown.keydown_0", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
		$(this).unbind("keydown.keydown_0");
	});

	//第一块
	_EsdDynamicTransformationScript.esdTagCircleNum1.focus(function (e) {
		$(this).bind("keydown.keydown_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagFrontNum1.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagCircleNum1.blur(function () {
		$(this).unbind("keydown.keydown_1");
	});

	//第二块
	_EsdDynamicTransformationScript.esdTagCircleNum2.focus(function (e) {
		$(this).bind("keydown.keydown_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum1.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum3.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagCircleNum2.blur(function () {
		$(this).unbind("keydown.keydown_2");
	});
	
	//第三块
	_EsdDynamicTransformationScript.esdTagCircleNum3.focus(function (e) {
		$(this).bind("keydown.keydown_3", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum2.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum4.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagCircleNum3.blur(function () {
		$(this).unbind("keydown.keydown_3");
	});
	
	//第四块
	_EsdDynamicTransformationScript.esdTagCircleNum4.focus(function (e) {
		$(this).bind("keydown.keydown_4", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum3.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.iframeTab3.mouseover();
				_EsdDynamicTransformationScript.iframeTab3.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagCircleNum4.blur(function () {
		$(this).unbind("keydown.keydown_4");
	});
	
	//轮播后的焦点
	_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function (e) {
		$(this).bind("keydown.keydown_6", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
				_EsdDynamicTransformationScript.esdTagCircleNum4.focus();
				return false;
			}else if (e.keyCode == 9) {
				
			}
		});
	});
	_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function () {
		$(this).unbind("keydown.keydown_6");
	});
	
	}
	
	
	
	var partB_Second = function(){
		
		//轮播右边的二级导航
		// 将iframe所包含的a链接数 第一个a元素 最后一个a元素赋值给第一个参数的js对象
		_EsdDynamicTransformationScript.getIframeInfos = function(jsObj,iframeObj){
			jsObj.aLink_num = iframeObj.contentWindow.document.getElementsByTagName("a").length;
			jsObj.first_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[0];
			jsObj.last_aLink = iframeObj.contentWindow.document.getElementsByTagName("a")[jsObj.aLink_num-3];
			jsObj.self = iframeObj;
		};
		
		// 声明iframe操作对象
		_EsdDynamicTransformationScript.iframe3 = {};
		_EsdDynamicTransformationScript.iframe4 = {};
		
		//通过方法赋值   
		_EsdDynamicTransformationScript.iframeElement3 = document.getElementsByTagName("iframe")[2];   // 需要修改 这里的iframe获取
		_EsdDynamicTransformationScript.iframeElement4 = document.getElementsByTagName("iframe")[3];   // 需要修改 这里的iframe获取
		
		//选项卡标签 jquery对象
		_EsdDynamicTransformationScript.iframeTab3 = $(".zlyxx .tabbox ul li:eq(0) a");  // 需要修改 这里的tab获取
		_EsdDynamicTransformationScript.iframeTab4 = $(".zlyxx .tabbox ul li:eq(1) a");  // 需要修改 这里的tab获取

		//通过方法赋值   
		_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe3,_EsdDynamicTransformationScript.iframeElement3);  
		_EsdDynamicTransformationScript.getIframeInfos(_EsdDynamicTransformationScript.iframe4,_EsdDynamicTransformationScript.iframeElement4); 

		//第一个标签 切换
		_EsdDynamicTransformationScript.iframeTab3.focus(function (e) {
			$(this).bind("keydown.iframeKeydown_3", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
					_EsdDynamicTransformationScript.esdTagCircleNum4.focus();
					return false;
				} else if (e.keyCode == 9) {
//					_EsdDynamicTransformationScript.iframeTab3.trigger("blur");
					$(_EsdDynamicTransformationScript.iframe3.self).focus();
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.iframeTab3.blur(function () {
			$(this).unbind("keydown.iframeKeydown_3");
		});

		// 第一个标签的第一个链接
		$(_EsdDynamicTransformationScript.iframe3.first_aLink).focus(function () {
			console.log("第一个iframe的第一条获得焦点");
			$(this).bind("keydown.iframeKeydown_first3", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					console.log("第一个iframe的第一条向上切换");
					$(this).trigger("blur");
					_EsdDynamicTransformationScript.iframeTab3.focus();
					return false;
				} else if (e.keyCode == 9) {
					console.log("第一个iframe的第一条继续切换");
				}
			});
		});
		$(_EsdDynamicTransformationScript.iframe3.first_aLink).blur(function () {
			$(this).unbind("keydown.iframeKeydown_first3");
		});

		// 第一个标签的最后一个链接
		$(_EsdDynamicTransformationScript.iframe3.last_aLink).focus(function () {
			$(this).bind("keydown.iframeKeydown_last3", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					
				} else if (e.keyCode == 9) {
					$(this).trigger("blur");
					_EsdDynamicTransformationScript.iframeTab4.mouseover();
					_EsdDynamicTransformationScript.iframeTab4.focus();
					return false;
				}
			});
		});
		$(_EsdDynamicTransformationScript.iframe3.last_aLink).blur(function () {
			$(this).unbind("keydown.iframeKeydown_last3");
		});


		//第二个标签 切换
		_EsdDynamicTransformationScript.iframeTab4.focus(function (e) {
			$(this).bind("keydown.iframeKeydown_4", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
//					_EsdDynamicTransformationScript.iframeTab4.trigger("blur");
					_EsdDynamicTransformationScript.iframeTab3.mouseover();
					$(_EsdDynamicTransformationScript.iframe3.last_aLink).focus();
					return false;
				} else if (e.keyCode == 9) {
//					_EsdDynamicTransformationScript.iframeTab4.trigger("blur");
					$(_EsdDynamicTransformationScript.iframe4.self).focus();
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.iframeTab4.blur(function () {
			$(this).unbind("keydown.iframeKeydown_4");
		});

		// 第二个标签的第一个链接
		$(_EsdDynamicTransformationScript.iframe4.first_aLink).focus(function () {
			$(this).bind("keydown.iframeKeydown_first4", function (e) {
				if (e.shiftKey && e.keyCode == 9) {
					$(this).trigger("blur");
					_EsdDynamicTransformationScript.iframeTab4.focus();
					return false;
				} else if (e.keyCode == 9) {
					
				}
			});
		});
		$(_EsdDynamicTransformationScript.iframe4.first_aLink).blur(function () {
			$(this).unbind("keydown.iframeKeydown_first4");
		});


	}
	
}



if(location.href=="http://mw.jl.gov.cn/xxgk/"){
//信息公开


//通知公告+人事管理
	//二层  

	//各个选项名称对应的内容数量
	 _EsdDynamicTransformationScript.num10 = $(".topc .w639:eq(0) .tabbox .content>div:eq(0) a").length-1;
	 _EsdDynamicTransformationScript.num11 = $(".topc .w639:eq(0) .tabbox .content>div:eq(0)").next().find("a").length-1;
	
	//各个选项名称
	 _EsdDynamicTransformationScript.esd4TagNum1 = $(".topc .w639:eq(0) .tabbox ul li:eq(0) a");
	 _EsdDynamicTransformationScript.esd4TagNum2 = $(".topc .w639:eq(0) .tabbox ul li:eq(1) a");
	
	//各个选项中的第一个内容
	 _EsdDynamicTransformationScript.esd4TagNum1Content1 = $(".topc .w639:eq(0) .tabbox .content>div:eq(0) a:eq(0)");
	 _EsdDynamicTransformationScript.esd4TagNum2Content1 = $(".topc .w639:eq(0) .tabbox .content>div:eq(0)").next().find("a:eq(0)");
	
	//各个选项中的最后一个内容
	 _EsdDynamicTransformationScript.esd4TagNum1ContentN = $(".topc .w639:eq(0) .tabbox .content>div:eq(0) a:eq("+_EsdDynamicTransformationScript.num10+")");
	 _EsdDynamicTransformationScript.esd4TagNum2ContentN = $(".topc .w639:eq(0) .tabbox .content>div:eq(0)").next().find("a:eq("+_EsdDynamicTransformationScript.num11+")");
	
	//第一块
	_EsdDynamicTransformationScript.esd4TagNum1.focus(function (e) {
		
		e = $(this).mouseover();
		$(this).bind("keydown.keydown4_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd4TagNum1Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd4TagNum1.blur(function () {
		
		$(this).unbind("keydown.keydown4_1");
	});

	_EsdDynamicTransformationScript.esd4TagNum1Content1.focus(function () {
		$(this).bind("keydown.keydown4_s1", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd4TagNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd4TagNum1Content1.blur(function () {
		$(this).unbind("keydown.keydown4_s1");
	});

	_EsdDynamicTransformationScript.esd4TagNum1ContentN.focus(function () {
		$(this).bind("keydown.keydown4_e1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd4TagNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd4TagNum1ContentN.blur(function () {
		$(this).unbind("keydown.keydown4_e1");
	});
	
	//第二块
	_EsdDynamicTransformationScript.esd4TagNum2.focus(function (e) {
		e = $(this).mouseover();
		$(this).bind("keydown.keydown4_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd4TagNum1.mouseover();
				_EsdDynamicTransformationScript.esd4TagNum1ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd4TagNum2Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd4TagNum2.blur(function () {
		$(this).unbind("keydown.keydown4_2");
	});



//提案议案+部门预决算信息
	//二层  

	//各个选项名称对应的内容数量
	 _EsdDynamicTransformationScript.num12 = $(".topc .ml4 .tabbox .content>div:eq(0) a").length-1;
	 _EsdDynamicTransformationScript.num13 = $(".topc .ml4 .tabbox .content>div:eq(0)").next().find("a").length-1;
	
	//各个选项名称
	 _EsdDynamicTransformationScript.esd5TagNum1 = $(".topc .ml4 .tabbox ul li:eq(0) a");
	 _EsdDynamicTransformationScript.esd5TagNum2 = $(".topc .ml4 .tabbox ul li:eq(1) a");
	
	//各个选项中的第一个内容
	 _EsdDynamicTransformationScript.esd5TagNum1Content1 = $(".topc .ml4 .tabbox .content>div:eq(0) a:eq(0)");
	 _EsdDynamicTransformationScript.esd5TagNum2Content1 = $(".topc .ml4 .tabbox .content>div:eq(0)").next().find("a:eq(0)");
	
	//各个选项中的最后一个内容
	 _EsdDynamicTransformationScript.esd5TagNum1ContentN = $(".topc .ml4 .tabbox .content>div:eq(0) a:eq("+_EsdDynamicTransformationScript.num12+")");
	 _EsdDynamicTransformationScript.esd5TagNum2ContentN = $(".topc .ml4 .tabbox .content>div:eq(0)").next().find("a:eq("+_EsdDynamicTransformationScript.num13+")");
	
	//第一块
	_EsdDynamicTransformationScript.esd5TagNum1.focus(function (e) {
		
		e = $(this).mouseover();
		$(this).bind("keydown.keydown5_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd5TagNum1Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd5TagNum1.blur(function () {
		
		$(this).unbind("keydown.keydown5_1");
	});

	_EsdDynamicTransformationScript.esd5TagNum1Content1.focus(function () {
		$(this).bind("keydown.keydown5_s1", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd5TagNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd5TagNum1Content1.blur(function () {
		$(this).unbind("keydown.keydown5_s1");
	});

	_EsdDynamicTransformationScript.esd5TagNum1ContentN.focus(function () {
		$(this).bind("keydown.keydown5_e1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd5TagNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd5TagNum1ContentN.blur(function () {
		$(this).unbind("keydown.keydown5_e1");
	});
	
	//第二块
	_EsdDynamicTransformationScript.esd5TagNum2.focus(function (e) {
		e = $(this).mouseover();
		$(this).bind("keydown.keydown5_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd5TagNum1.mouseover();
				_EsdDynamicTransformationScript.esd5TagNum1ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd5TagNum2Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd5TagNum2.blur(function () {
		$(this).unbind("keydown.keydown5_2");
	});



//部门预算+部门决算
	//二层  

	//各个选项名称对应的内容数量
	 _EsdDynamicTransformationScript.num14 = $(".topc .ml4 .tabbox .content .content>div:eq(0) a").length-1;
	 _EsdDynamicTransformationScript.num15 = $(".topc .ml4 .tabbox .content .content>div:eq(0)").next().find("a").length-1;
	
	//各个选项名称
	 _EsdDynamicTransformationScript.esd6TagNum1 = $(".topc .ml4 .tabbox .content>div:eq(0)").next().find("a:eq(0)");
	 _EsdDynamicTransformationScript.esd6TagNum2 = $(".topc .ml4 .tabbox .content>div:eq(0)").next().find("a:eq(1)");
	
	//各个选项中的第一个内容
	 _EsdDynamicTransformationScript.esd6TagNum1Content1 = $(".topc .ml4 .tabbox .content .content>div:eq(0) a:eq(0)");
	 _EsdDynamicTransformationScript.esd6TagNum2Content1 = $(".topc .ml4 .tabbox .content .content>div:eq(0)").next().find("a:eq(0)");
	
	//各个选项中的最后一个内容
	 _EsdDynamicTransformationScript.esd6TagNum1ContentN = $(".topc .ml4 .tabbox .content .content>div:eq(0) a:eq("+_EsdDynamicTransformationScript.num14+")");
	 _EsdDynamicTransformationScript.esd6TagNum2ContentN = $(".topc .ml4 .tabbox .content .content>div:eq(0)").next().find("a:eq("+_EsdDynamicTransformationScript.num15+")");
	
	//第一块
	_EsdDynamicTransformationScript.esd6TagNum1.focus(function (e) {
		
		e = $(this).mouseover();
		$(this).bind("keydown.keydown6_1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd6TagNum1Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd6TagNum1.blur(function () {
		
		$(this).unbind("keydown.keydown6_1");
	});

	_EsdDynamicTransformationScript.esd6TagNum1Content1.focus(function () {
		$(this).bind("keydown.keydown6_s1", function (e) {
			if (e.shiftKey && e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd6TagNum1.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd6TagNum1Content1.blur(function () {
		$(this).unbind("keydown.keydown6_s1");
	});

	_EsdDynamicTransformationScript.esd6TagNum1ContentN.focus(function () {
		$(this).bind("keydown.keydown6_e1", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd6TagNum2.focus();
				return false;
			}
		});
	});
	_EsdDynamicTransformationScript.esd6TagNum1ContentN.blur(function () {
		$(this).unbind("keydown.keydown6_e1");
	});
	
	//第二块
	_EsdDynamicTransformationScript.esd6TagNum2.focus(function (e) {
		e = $(this).mouseover();
		$(this).bind("keydown.keydown6_2", function (e) {
			if(e.shiftKey&&e.keyCode==9){
				_EsdDynamicTransformationScript.esd6TagNum1.mouseover();
				_EsdDynamicTransformationScript.esd6TagNum1ContentN.focus();
				return false;
			}else if (e.keyCode == 9) {
				_EsdDynamicTransformationScript.esd6TagNum2Content1.focus();
				console.log(document.activeElement);
				return false;
			}
		});

	});
	_EsdDynamicTransformationScript.esd6TagNum2.blur(function () {
		$(this).unbind("keydown.keydown6_2");
	});


}



if(location.href=="http://mw.jl.gov.cn/hdjl/mwxx/"){
	//民委信箱
	_EsdDynamicTransformationScript.slidePointInterval = setInterval(function () {
		if ( document.getElementsByTagName("iframe")[2].contentWindow.document.getElementById("SubmitButton") != undefined ) {
			clearInterval(_EsdDynamicTransformationScript.slidePointInterval);
			
		var inputIframe = document.getElementsByTagName("iframe")[2].contentWindow.document;
		$(inputIframe).find("#frmData input:eq(0)").attr({placeholder:"咨询人",title:"咨询人"});
		$(inputIframe).find("#frmData input:eq(1)").attr({placeholder:"联系电话",title:"联系电话"});
		$(inputIframe).find("#frmData input:eq(2)").attr({placeholder:"通讯地址",title:"通讯地址"});
		$(inputIframe).find("#frmData input:eq(3)").attr({placeholder:"电子邮件",title:"电子邮件"});
		$(inputIframe).find("#frmData input:eq(4)").attr({placeholder:"标题",title:"标题"});
		$(inputIframe).find("#frmData textarea").attr({placeholder:"内容",title:"内容"});
		
		$(inputIframe).find("#SubmitButton").attr("title","提交");	
		$(inputIframe).find("#ResetButton").attr("title","重置");	
		
		}
	}, 500);

}	







